package cn.virens.support;

import cn.virens.TioUtil;
import cn.virens.app.main.ComponentTimer;
import cn.virens.packet.WritePacket;

public class SelectDataRunnableHeat extends ComponentTimer<TCPServerImplHeartbeat> {

	public SelectDataRunnableHeat(TCPServerImplHeartbeat cmpt, String name) {
		super(cmpt, name);
	}

	@Override
	protected void doRun() throws Exception {
		cmpt.channelForEach((channelContext) -> {
			// 构建指令包
			WritePacket writePacket = TioUtil.write(channelContext);
			writePacket.cmd("0002");

			// 执行发送
			if (TioUtil.write(channelContext, writePacket)) {
				logger.debug("查询数据0002指令已下发");
			}
		});
	}
}
